import pyecharts.options as opts
from pyecharts.charts import Scatter
import xlrd
import pyecharts.options as opts
data=xlrd.open_workbook(r'C:\Users\chumenliuxiang\Desktop\实验室作业\第一问\第一问.xls','r')
sheet_num=data.nsheets
print(sheet_num)
biao1=data.sheet_by_name('Sheet1')
# # print(biao1)
# hours=biao1.col_values(0)
# scores=biao1.col_values(1)
# # print(hours)
# # print(scores)
# hours=hours[1:]
# print(hours)
# scores=scores[1:]
# print(scores)
# x_data = hours
# y_data = scores
# #————————————————————数据处理完毕
# (
#     Scatter()
#     .add_xaxis(xaxis_data=scores)
#     .add_yaxis(
#         series_name="",
#         y_axis=hours,
#         label_opts=opts.LabelOpts(is_show=True),
#     )
#     .set_series_opts()
#     .set_global_opts(
#         title_opts=opts.TitleOpts(title="学习时长和成绩的散点图",pos_left='center',pos_bottom='1%'),
#         xaxis_opts=opts.AxisOpts(
#             type_="value", splitline_opts=opts.SplitLineOpts(is_show=True)
#         ),
#         yaxis_opts=opts.AxisOpts(
#             type_="value",
#             axistick_opts=opts.AxisTickOpts(is_show=True),
#             splitline_opts=opts.SplitLineOpts(is_show=True),
#         ),
#         tooltip_opts=opts.TooltipOpts(is_show=False),
#     )
#     .render("第一问.html")
# )